import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/cabinet',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/refrigerator/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/refrigerator',
    method: 'put',
    data
  })
}

export function openDoor(params) {
  return request({
    url: 'api/refrigerator/openDoor',
    method: 'post',
    params
  })
}

export function closeDoor(params) {
  return request({
    url: 'api/refrigerator/closeDoor',
    method: 'post',
    params
  })
}

export function getRefrigeratorListAPI () {
  return request({
    url: 'api/cabinet/refrigeratorList',
    method: 'get',
  })
}
export default { add, edit, del }
